package Demo1;

public class DianNao {
    public void usedevice(IUSB usb){
        usb.opendevice();
        if(usb instanceof Mouse){
            ((Mouse)usb).mouseClick();
        }
        else if(usb instanceof JianPan){
            ((JianPan)usb).jianPanClick();
        }
        usb.closedevice();
    }
}
